package com.github.pig.admin.util;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.github.pig.admin.model.entity.SysDict;
import com.github.pig.admin.service.dict.SysDictService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CommonService {

    @Autowired
    private SysDictService sysDictService;
    /**
     * 根据字典类型、value获取字典数据
     * @param type
     * @param value
     * @return
     */
    public List queryDicByType(String type, String value) {
        AjaxJson ajaxJson = new AjaxJson();
        EntityWrapper<SysDict> entityWrapper = new EntityWrapper<SysDict>();
        entityWrapper.eq("type",type);
        entityWrapper.eq("value",value);
        return sysDictService.selectList(entityWrapper);
    }
}
